<?php
/**
 * Created by PhpStorm.
 * User: 11509
 * Date: 2021/3/16
 * Time: 14:52
 */

namespace app\admin\controller;

use app\admin\logic\VipLogic;
use app\admin\model\Users;
use app\BaseController;
use think\facade\Db;
use think\facade\Request;
use think\facade\View;

class Vip extends BaseController
{
    public function vipList()
    {
        $sel=Users::getUsersSel();

        View::assign('sel',$sel);

        return View::fetch();
    }
    public function vipAdd()
    {

        if (Request::isPost()){

            $param = Request::param();
            $data = VipLogic::getVipData($param);
            list($res,$msg) = Users::addUsersVipInfo($data);
            if ($res){
                $this->success($msg,url('vipList'));
            }else{
                $this->error('网络异常,添加失败');
            }
        }



        return View::fetch();
    }
}